package com.hzgj.bcl.soa.rpc.server;

import com.google.common.collect.Maps;

import java.util.Map;

/**
 * Created by ye.pan on 2015/7/13.
 */
public class ServerStat {

    private static ServerStat instance = new ServerStat();
    private static Map<Integer, ConnectionHandler> connects = Maps.newHashMap();

    private ServerStat() {
    }

    public static ServerStat getInstance() {
        return instance;
    }

    public static ConnectionHandler getConnectionHandler(int port) {
        return connects.get(port);
    }

    public void addConnectionHandler(int port, ConnectionHandler connectionHandler) {
        connects.putIfAbsent(port, connectionHandler);
    }
}
